 ///
 /// @file    computer.cc
 /// @author  lemon(haohb13@gmail.com)
 /// @date    2016-02-25 19:05:13
 ///
 
#include <string.h>
#include <iostream>

using std::cout;
using std::endl;

class Computer
{
public://对外提供接口
	void setBrand(char * brand)
	{
		strcpy(_brand, brand);
		print();//在类里面使用私有的成员函数
	}
	void setPrice(float fprice)
	{
		_fprice = fprice;
	}
private:
	void print()	
	{
		cout << "品牌：" << _brand << endl;//在类里面使用私有的成员数据

		cout << "价格：" << _fprice << endl;
	}
private:
	char _brand[20];
	float _fprice;
};


int main(void)
{
	int a;
	Computer pc1;//类的实例化
	//pc1._fprice = 10;//信息隐藏
	pc1.setPrice(5000);
	pc1.setBrand("Thinkpad");
	//pc1.print();

	return 0;
}
